package com.inboyu.order.domain;

import com.inboyu.admin.domain.ContractRepository;

/**
 * 订单领域服务
 */
public class OrderDomainService {

    private OrderRepository orderRepository;

    private ContractRepository contractRepository;

    private RoomRepository roomRepository;

    // 其他服务引用 feign 调用形式

    public OrderDomainService(OrderRepository orderRepository, ContractRepository contractRepository) {
        this.orderRepository = orderRepository;
        this.contractRepository = contractRepository;
    }

    public int createOrder(ContractAggregation contractAggregation) {
        // todo 创建订单
        throw new UnsupportedOperationException();
    }

    public int updateOrder(ContractAggregation contractAggregation) {
        // todo 更新订单
        throw new UnsupportedOperationException();
    }

    public RoomEntity findRoomById(String roomId) {
        return roomRepository.findById(roomId); // 需要状态判定
    }
}
